<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>热门投票 - 社交网站</title>
    
    <!-- 引入所需的CDN文件 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #eff6ff;
            --secondary: #64748b;
            --accent: #f97316;
            --light: #f8fafc;
            --dark: #1e293b;
            --shadow: 0 4px 12px rgba(0,0,0,0.08);
            --transition: all 0.3s ease;
        }
        
        body {
            background-color: #f1f5f9;
            color: var(--dark);
        }
        
        .vote-card {
            transition: var(--transition);
            border-radius: 12px;
            overflow: hidden;
            background-color: white;
            border: none;
            box-shadow: var(--shadow);
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        
        .vote-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        
        .vote-image-container {
            position: relative;
            overflow: hidden;
        }
        
        .vote-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }
        
        .vote-card:hover .vote-image {
            transform: scale(1.05);
        }
        
        .vote-tag {
            position: absolute;
            top: 12px;
            left: 12px;
            font-size: 0.8rem;
            padding: 3px 10px;
            border-radius: 20px;
            background-color: var(--primary);
            color: white;
            font-weight: 500;
            z-index: 2;
        }
        
        .vote-participants {
            position: absolute;
            top: 12px;
            right: 12px;
            font-size: 0.8rem;
            padding: 3px 10px;
            border-radius: 20px;
            background-color: rgba(0,0,0,0.6);
            color: white;
            font-weight: 500;
            z-index: 2;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .multi-image-grid {
            display: grid;
            gap: 4px;
            height: 100%;
        }
        
        .multi-image-2 {
            grid-template-columns: 1fr 1fr;
        }
        
        .multi-image-3 {
            grid-template-columns: 1fr 1fr;
        }
        
        .multi-image-3 img:last-child {
            grid-column: span 2;
        }
        
        .multi-image-4 {
            grid-template-columns: 1fr 1fr;
        }
        
        .vote-info {
            padding: 1.25rem;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .vote-title {
            font-size: 1.15rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--dark);
            transition: var(--transition);
        }
        
        .vote-card:hover .vote-title {
            color: var(--primary);
        }
        
        .vote-meta {
            display: flex;
            align-items: center;
            color: var(--secondary);
            font-size: 0.85rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            gap: 1rem;
        }
        
        .vote-meta i {
            margin-right: 4px;
            color: var(--primary);
        }
        
        .vote-description {
            color: var(--secondary);
            font-size: 0.9rem;
            line-height: 1.6;
            margin-bottom: 1rem;
            flex: 1;
        }
        
        .options-hint {
            padding: 12px;
            border-radius: 8px;
            background-color: var(--primary-light);
            color: var(--primary);
            font-size: 0.9rem;
            margin-bottom: 1.25rem;
            text-align: center;
        }
        
        .vote-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: auto;
        }
        
        .vote-stats {
            display: flex;
            align-items: center;
            font-size: 0.85rem;
            color: var(--secondary);
        }
        
        .vote-btn {
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            padding: 6px 18px;
            font-size: 0.9rem;
            font-weight: 500;
            transition: var(--transition);
        }
        
        .vote-btn:hover {
            background-color: #2563eb;
            transform: translateY(-2px);
        }
        
        .voted-btn {
            background-color: var(--primary-light);
            color: var(--primary);
            border: 1px solid var(--primary);
            border-radius: 6px;
            padding: 6px 18px;
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        .layout-tabs .nav-link {
            color: var(--secondary);
            border: none;
            border-bottom: 2px solid transparent;
            border-radius: 0;
            padding: 0.5rem 1.25rem;
            font-weight: 500;
        }
        
        .layout-tabs .nav-link.active {
            color: var(--primary);
            border-bottom: 2px solid var(--primary);
            background: transparent;
        }
        
        /* 列表布局样式 */
        .list-layout .vote-card {
            flex-direction: row;
            height: auto;
        }
        
        .list-layout .vote-image-container {
            flex: 0 0 220px;
        }
        
        @media (max-width: 768px) {
            .list-layout .vote-card {
                flex-direction: column;
            }
            
            .list-layout .vote-image-container {
                flex: none;
                height: 180px;
            }
        }
    </style>
</head>
<body>
    <div class="container mt-5 mb-10">
        <h2 class="text-primary fw-bold mb-2">热门投票</h2>
        <p class="text-secondary mb-6">参与话题投票，表达你的观点</p>
        
        <!-- 布局切换 -->
        <ul class="nav layout-tabs mb-6" id="layoutTabs" role="tablist">
            <li class="nav-item" role="presentation">
                <button class="nav-link active" id="card-layout-tab" data-bs-toggle="tab" 
                        data-bs-target="#card-layout" type="button" role="tab" 
                        aria-controls="card-layout" aria-selected="true">
                    <i class="fas fa-th-large me-2"></i>卡片布局
                </button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="list-layout-tab" data-bs-toggle="tab" 
                        data-bs-target="#list-layout" type="button" role="tab" 
                        aria-controls="list-layout" aria-selected="false">
                    <i class="fas fa-list me-2"></i>列表布局
                </button>
            </li>
        </ul>
        
        <!-- 投票推荐内容区域 -->
        <div class="tab-content" id="layoutTabsContent">
            <!-- 卡片布局 -->
            <div class="tab-pane fade show active" id="card-layout" role="tabpanel" aria-labelledby="card-layout-tab">
                <div class="row gap-4">
                    <!-- 无图投票 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="vote-card">
                            <div class="vote-info">
                                <div class="d-flex justify-content-between items-start mb-3">
                                    <span class="vote-tag">生活方式</span>
                                    <span class="vote-participants">
                                        <i class="fas fa-users"></i> 1,258人参与
                                    </span>
                                </div>
                                
                                <h3 class="vote-title">周末你更喜欢哪种放松方式？</h3>
                                
                                <div class="vote-meta">
                                    <div><i class="far fa-calendar-alt"></i> 剩余3天结束</div>
                                    <div><i class="fas fa-user"></i> 发起者: 生活探索家</div>
                                </div>
                                
                                <p class="vote-description">
                                    忙碌的工作周结束后，周末是放松充电的好时机。你更倾向于哪种周末放松方式？是宅家休息还是外出活动？
                                </p>
                                
                                <div class="options-hint">
                                    <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                                </div>
                                
                                <div class="vote-actions">
                                    <div class="vote-stats">
                                        <i class="far fa-comment-alt me-1"></i> 328条讨论
                                    </div>
                                    <button class="vote-btn">
                                        <i class="fas fa-check-circle me-1"></i> 参与投票
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 单图投票 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="vote-card">
                            <div class="vote-image-container" style="height: 180px;">
                                <img src="https://picsum.photos/600/400?random=50" alt="夏季饮品" class="vote-image">
                                <span class="vote-tag">美食</span>
                                <span class="vote-participants">
                                    <i class="fas fa-users"></i> 2,845人参与
                                </span>
                            </div>
                            
                            <div class="vote-info">
                                <h3 class="vote-title">夏天你最喜欢的饮品是什么？</h3>
                                
                                <div class="vote-meta">
                                    <div><i class="far fa-calendar-alt"></i> 剩余5天结束</div>
                                    <div><i class="fas fa-user"></i> 发起者: 美食爱好者</div>
                                </div>
                                
                                <p class="vote-description">
                                    炎炎夏日，一杯清凉饮品能带来舒适体验。在各种夏季饮品中，你最喜欢哪一种？
                                </p>
                                
                                <div class="options-hint">
                                    <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                                </div>
                                
                                <div class="vote-actions">
                                    <div class="vote-stats">
                                        <i class="far fa-comment-alt me-1"></i> 542条讨论
                                    </div>
                                    <button class="voted-btn">
                                        <i class="fas fa-check me-1"></i> 已投票
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 双图投票 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="vote-card">
                            <div class="vote-image-container" style="height: 180px;">
                                <div class="multi-image-grid multi-image-2 h-100">
                                    <img src="https://picsum.photos/300/300?random=51" alt="城市生活" class="vote-image">
                                    <img src="https://picsum.photos/300/300?random=52" alt="乡村生活" class="vote-image">
                                </div>
                                <span class="vote-tag">生活态度</span>
                                <span class="vote-participants">
                                    <i class="fas fa-users"></i> 3,621人参与
                                </span>
                            </div>
                            
                            <div class="vote-info">
                                <h3 class="vote-title">你更向往哪种生活环境？</h3>
                                
                                <div class="vote-meta">
                                    <div><i class="far fa-calendar-alt"></i> 剩余7天结束</div>
                                    <div><i class="fas fa-user"></i> 发起者: 人生思考者</div>
                                </div>
                                
                                <p class="vote-description">
                                    生活环境对我们的心情和生活质量有很大影响。在繁华的城市和宁静的乡村之间，你更向往哪种生活环境？
                                </p>
                                
                                <div class="options-hint">
                                    <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                                </div>
                                
                                <div class="vote-actions">
                                    <div class="vote-stats">
                                        <i class="far fa-comment-alt me-1"></i> 876条讨论
                                    </div>
                                    <button class="vote-btn">
                                        <i class="fas fa-check-circle me-1"></i> 参与投票
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 三图投票 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="vote-card">
                            <div class="vote-image-container" style="height: 180px;">
                                <div class="multi-image-grid multi-image-3 h-100">
                                    <img src="https://picsum.photos/300/200?random=53" alt="阅读" class="vote-image">
                                    <img src="https://picsum.photos/300/200?random=54" alt="运动" class="vote-image">
                                    <img src="https://picsum.photos/604/200?random=55" alt="学习新技能" class="vote-image">
                                </div>
                                <span class="vote-tag">自我提升</span>
                                <span class="vote-participants">
                                    <i class="fas fa-users"></i> 1,987人参与
                                </span>
                            </div>
                            
                            <div class="vote-info">
                                <h3 class="vote-title">业余时间你更喜欢哪种活动？</h3>
                                
                                <div class="vote-meta">
                                    <div><i class="far fa-calendar-alt"></i> 剩余2天结束</div>
                                    <div><i class="fas fa-user"></i> 发起者: 成长学院</div>
                                </div>
                                
                                <p class="vote-description">
                                    业余时间的活动选择反映了我们的兴趣和价值观。在以下几种活动中，你在业余时间更喜欢哪种？
                                </p>
                                
                                <div class="options-hint">
                                    <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                                </div>
                                
                                <div class="vote-actions">
                                    <div class="vote-stats">
                                        <i class="far fa-comment-alt me-1"></i> 412条讨论
                                    </div>
                                    <button class="vote-btn">
                                        <i class="fas fa-check-circle me-1"></i> 参与投票
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 四图投票 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="vote-card">
                            <div class="vote-image-container" style="height: 180px;">
                                <div class="multi-image-grid multi-image-4 h-100">
                                    <img src="https://picsum.photos/300/300?random=56" alt="悬疑电影" class="vote-image">
                                    <img src="https://picsum.photos/300/300?random=57" alt="喜剧电影" class="vote-image">
                                    <img src="https://picsum.photos/300/300?random=58" alt="爱情电影" class="vote-image">
                                    <img src="https://picsum.photos/300/300?random=59" alt="科幻电影" class="vote-image">
                                </div>
                                <span class="vote-tag">娱乐</span>
                                <span class="vote-participants">
                                    <i class="fas fa-users"></i> 4,215人参与
                                </span>
                            </div>
                            
                            <div class="vote-info">
                                <h3 class="vote-title">你最喜欢的电影类型是什么？</h3>
                                
                                <div class="vote-meta">
                                    <div><i class="far fa-calendar-alt"></i> 剩余10天结束</div>
                                    <div><i class="fas fa-user"></i> 发起者: 电影爱好者联盟</div>
                                </div>
                                
                                <p class="vote-description">
                                    电影是我们生活中重要的娱乐方式。不同类型的电影能带给我们不同的情感体验，你最喜欢哪种类型的电影？
                                </p>
                                
                                <div class="options-hint">
                                    <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                                </div>
                                
                                <div class="vote-actions">
                                    <div class="vote-stats">
                                        <i class="far fa-comment-alt me-1"></i> 963条讨论
                                    </div>
                                    <button class="voted-btn">
                                        <i class="fas fa-check me-1"></i> 已投票
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 单图投票 -->
                    <div class="col-12 col-md-6 col-lg-4">
                        <div class="vote-card">
                            <div class="vote-image-container" style="height: 180px;">
                                <img src="https://picsum.photos/600/400?random=60" alt="旅行" class="vote-image">
                                <span class="vote-tag">旅行</span>
                                <span class="vote-participants">
                                    <i class="fas fa-users"></i> 2,578人参与
                                </span>
                            </div>
                            
                            <div class="vote-info">
                                <h3 class="vote-title">你更喜欢哪种旅行方式？</h3>
                                
                                <div class="vote-meta">
                                    <div><i class="far fa-calendar-alt"></i> 剩余4天结束</div>
                                    <div><i class="fas fa-user"></i> 发起者: 环球旅行者</div>
                                </div>
                                
                                <p class="vote-description">
                                    旅行是开阔眼界的好方式，不同的旅行方式会带来不同的体验。你更喜欢哪种旅行方式？
                                </p>
                                
                                <div class="options-hint">
                                    <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                                </div>
                                
                                <div class="vote-actions">
                                    <div class="vote-stats">
                                        <i class="far fa-comment-alt me-1"></i> 632条讨论
                                    </div>
                                    <button class="vote-btn">
                                        <i class="fas fa-check-circle me-1"></i> 参与投票
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 列表布局 -->
            <div class="tab-pane fade" id="list-layout" role="tabpanel" aria-labelledby="list-layout-tab">
                <div class="list-layout space-y-4">
                    <!-- 无图投票（列表） -->
                    <div class="vote-card">
                        <div class="vote-info">
                            <div class="d-flex justify-content-between items-start mb-3">
                                <span class="vote-tag">生活方式</span>
                                <span class="vote-participants">
                                    <i class="fas fa-users"></i> 1,258人参与
                                </span>
                            </div>
                            
                            <h3 class="vote-title">周末你更喜欢哪种放松方式？</h3>
                            
                            <div class="vote-meta">
                                <div><i class="far fa-calendar-alt"></i> 剩余3天结束</div>
                                <div><i class="fas fa-user"></i> 发起者: 生活探索家</div>
                                <div class="vote-stats">
                                    <i class="far fa-comment-alt me-1"></i> 328条讨论
                                </div>
                            </div>
                            
                            <p class="vote-description">
                                忙碌的工作周结束后，周末是放松充电的好时机。你更倾向于哪种周末放松方式？是宅家休息还是外出活动？
                            </p>
                            
                            <div class="options-hint">
                                <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                            </div>
                            
                            <div class="vote-actions">
                                <button class="vote-btn">
                                    <i class="fas fa-check-circle me-1"></i> 参与投票
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 单图投票（列表） -->
                    <div class="vote-card">
                        <div class="vote-image-container">
                            <img src="https://picsum.photos/600/400?random=50" alt="夏季饮品" class="vote-image">
                            <span class="vote-tag">美食</span>
                            <span class="vote-participants">
                                <i class="fas fa-users"></i> 2,845人参与
                            </span>
                        </div>
                        
                        <div class="vote-info">
                            <h3 class="vote-title">夏天你最喜欢的饮品是什么？</h3>
                            
                            <div class="vote-meta">
                                <div><i class="far fa-calendar-alt"></i> 剩余5天结束</div>
                                <div><i class="fas fa-user"></i> 发起者: 美食爱好者</div>
                                <div class="vote-stats">
                                    <i class="far fa-comment-alt me-1"></i> 542条讨论
                                </div>
                            </div>
                            
                            <p class="vote-description">
                                炎炎夏日，一杯清凉饮品能带来舒适体验。在各种夏季饮品中，你最喜欢哪一种？
                            </p>
                            
                            <div class="options-hint">
                                <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                            </div>
                            
                            <div class="vote-actions">
                                <button class="voted-btn">
                                    <i class="fas fa-check me-1"></i> 已投票
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 三图投票（列表） -->
                    <div class="vote-card">
                        <div class="vote-image-container">
                            <div class="multi-image-grid multi-image-3 h-100">
                                <img src="https://picsum.photos/300/200?random=53" alt="阅读" class="vote-image">
                                <img src="https://picsum.photos/300/200?random=54" alt="运动" class="vote-image">
                                <img src="https://picsum.photos/604/200?random=55" alt="学习新技能" class="vote-image">
                            </div>
                            <span class="vote-tag">自我提升</span>
                            <span class="vote-participants">
                                <i class="fas fa-users"></i> 1,987人参与
                            </span>
                        </div>
                        
                        <div class="vote-info">
                            <h3 class="vote-title">业余时间你更喜欢哪种活动？</h3>
                            
                            <div class="vote-meta">
                                <div><i class="far fa-calendar-alt"></i> 剩余2天结束</div>
                                <div><i class="fas fa-user"></i> 发起者: 成长学院</div>
                                <div class="vote-stats">
                                    <i class="far fa-comment-alt me-1"></i> 412条讨论
                                </div>
                            </div>
                            
                            <p class="vote-description">
                                业余时间的活动选择反映了我们的兴趣和价值观。在以下几种活动中，你在业余时间更喜欢哪种？
                            </p>
                            
                            <div class="options-hint">
                                <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                            </div>
                            
                            <div class="vote-actions">
                                <button class="vote-btn">
                                    <i class="fas fa-check-circle me-1"></i> 参与投票
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 四图投票（列表） -->
                    <div class="vote-card">
                        <div class="vote-image-container">
                            <div class="multi-image-grid multi-image-4 h-100">
                                <img src="https://picsum.photos/300/300?random=56" alt="悬疑电影" class="vote-image">
                                <img src="https://picsum.photos/300/300?random=57" alt="喜剧电影" class="vote-image">
                                <img src="https://picsum.photos/300/300?random=58" alt="爱情电影" class="vote-image">
                                <img src="https://picsum.photos/300/300?random=59" alt="科幻电影" class="vote-image">
                            </div>
                            <span class="vote-tag">娱乐</span>
                            <span class="vote-participants">
                                <i class="fas fa-users"></i> 4,215人参与
                            </span>
                        </div>
                        
                        <div class="vote-info">
                            <h3 class="vote-title">你最喜欢的电影类型是什么？</h3>
                            
                            <div class="vote-meta">
                                <div><i class="far fa-calendar-alt"></i> 剩余10天结束</div>
                                <div><i class="fas fa-user"></i> 发起者: 电影爱好者联盟</div>
                                <div class="vote-stats">
                                    <i class="far fa-comment-alt me-1"></i> 963条讨论
                                </div>
                            </div>
                            
                            <p class="vote-description">
                                电影是我们生活中重要的娱乐方式。不同类型的电影能带给我们不同的情感体验，你最喜欢哪种类型的电影？
                            </p>
                            
                            <div class="options-hint">
                                <i class="fas fa-list-ul me-1"></i> 点击参与投票查看选项
                            </div>
                            
                            <div class="vote-actions">
                                <button class="voted-btn">
                                    <i class="fas fa-check me-1"></i> 已投票
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="text-center mt-8">
            <button class="btn btn-outline-primary px-6 py-2 rounded-full hover:bg-primary hover:text-white transition-all">
                查看更多投票 <i class="fas fa-chevron-down ms-2"></i>
            </button>
        </div>
    </div>

    <script>
        // 初始化布局切换
        const layoutTabs = new bootstrap.Tab('#layoutTabs');
        
        // 投票功能 - 点击参与投票时的交互
        document.querySelectorAll('.vote-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 在实际应用中，这里会跳转到包含选项的投票详情页
                // 这里使用弹窗模拟
                const voteCard = this.closest('.vote-card');
                const voteTitle = voteCard.querySelector('.vote-title').textContent;
                
                alert(`正在打开投票："${voteTitle}"\n此处将显示投票选项供您选择`);
                
                // 模拟投票后状态变化
                this.classList.remove('vote-btn');
                this.classList.add('voted-btn');
                this.innerHTML = '<i class="fas fa-check me-1"></i> 已投票';
                
                // 更新参与人数
                const participantsEl = voteCard.querySelector('.vote-participants');
                const currentCount = parseInt(participantsEl.textContent.match(/(\d+)/)[1]);
                participantsEl.innerHTML = `<i class="fas fa-users"></i> ${currentCount + 1}人参与`;
            });
        });
        
        // 已投票按钮点击事件
        document.querySelectorAll('.voted-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const voteCard = this.closest('.vote-card');
                const voteTitle = voteCard.querySelector('.vote-title').textContent;
                alert(`您已参与投票："${voteTitle}"\n可在个人中心查看您的投票记录`);
            });
        });
        
        // 加载更多功能
        document.querySelector('.btn-outline-primary').addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin me-2"></i> 加载中...';
            
            // 模拟加载延迟
            setTimeout(() => {
                this.innerHTML = '查看更多投票 <i class="fas fa-chevron-down ms-2"></i>';
                // 实际应用中这里会添加新的投票内容
            }, 1500);
        });
    </script>
</body>
</html>
    
